/*
 * GeoVISTA Center (Penn State, Dept. of Geography)
 * Copyright (c), 2003-2011,  Jin Chen and Alan M. MacEachren, GeoVISTA Center, Penn State University
 * All Rights Researved.
 *
 * This library is developed and distributed for free usage,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * You can redistribute and/or modify it under the terms of the
 * Simplified BSD License
 *
 *
 *
 *
 *
 *
 *
 *
 * @author: jin Chen 
 * @date: Aug 28, 2003$
 * @version: 1.0
 */
package edu.psu.geovista.app.pcp.toolkits.dialog;

import javax.swing.*;
import java.awt.*;

public class FontChooser extends JOptionPane{
    public  static Font showFontDialag(Component parent) {
        FontPanel fp=new FontPanel();
        int i=JOptionPane.showOptionDialog(parent,fp,"Please set font",2, -1, null, null, null);
        if(i==0)//click ok
            return fp.getSelectedFont() ;
        else
            return null;
    }
    public  static Font showFontDialag(Component parent,Font init) {
        FontPanel fp=new FontPanel();
        fp.setSelectedFont(init);
        int i=JOptionPane.showOptionDialog(parent,fp,"Please set font",2, -1, null, null, null);
        if(i==0)//click ok
            return fp.getSelectedFont() ;
        else
            return null;
    }
   
}
